package chatclient.applets;

import chatclient.netio.AttrList;
import chatclient.netio.Event;
import chatclient.tools.NoteContainer;
import java.awt.Image;
import java.awt.event.ComponentEvent;
import java.util.Enumeration;
import java.util.Vector;

public class TextView extends ChatView
        implements NoteContainer {

    private TextPanel textPanel;
    
    @Override
    public void init() {

        super.init();

        if(suspendKey == null)
        {
            suspendKey = "text";
        }
    }    
    
    
    @Override
    protected void initChatPanel() {
        textPanel = new TextPanel(this);
        chatPanel = textPanel;
    }    
    
    
    @Override
    public void clearState() {
        super.clearState();
        textPanel.clearState();
    }

    @Override
    public void initState() {
        super.initState();
        textPanel.initState();
    }

    @Override
    public void saveState(Vector vector) {
        super.saveState(vector);
        textPanel.saveState(vector);
    }

    @Override
    public void restoreState(Enumeration enumeration) {
        super.restoreState(enumeration);
        textPanel.restoreState(enumeration);
    }

 
    @Override
    protected void doEvent(Event event, boolean ignored, AttrList attrlist, boolean isNicknameSet, String nickname,
            boolean isMeSource, boolean isTargetNameSet, String targetName, boolean isMeTarget, boolean isChannelNameSet, String channelName, boolean isMyActiveChannel) {
        
        super.doEvent(event, ignored, attrlist, isNicknameSet, nickname, isMeSource, isTargetNameSet, targetName, isMeTarget, isChannelNameSet, channelName, isMyActiveChannel);
        
        textPanel.doEvent(event, ignored, attrlist, isNicknameSet, nickname, isMeSource, isTargetNameSet, targetName, isMeTarget, isChannelNameSet, channelName, isMyActiveChannel);
    }

 

    @Override
    public void doInternalEvent(String parameter, AttrList attrlist) {
       textPanel.doInternalEvent(parameter, attrlist);
    }


    @Override
    public void updatedBgimage(Image image) {
        super.updatedBgimage(image);
        textPanel.updatedBgimage(image);
    }

    @Override
    public void startedPrivate(String s) {
        textPanel.startedPrivate(s);
    }

    @Override
    public void endedPrivate(String s) {
        textPanel.endedPrivate(s);
    }

    @Override
    public void clearedNotes(String s) {
        textPanel.clearedNotes(s);
    }

    public void selectedTab(int i) {
        textPanel.selectedTab(i);
    }

    public int getSelectedTab() {
        return textPanel.getSelectedTab();
    }

    public void componentResized(ComponentEvent componentevent) {
        textPanel.componentResized(componentevent);
    }


}
